/*
 * @Description: 
 * @Author: 李璕
 * @Date: 2019-07-10 10:56:42
 * @LastEditTime: 2019-07-10 11:02:20
 * @LastEditors: 李璕
 */
const install = Vue => {
  const Bus = new Vue({
    methods: {
      emit(event, ...args) {
        this.$emit(event, ...args);
      },
      on(event, callback) {
        this.$on(event, callback);
      },
      off(event, callback) {
        this.$off(event, callback);
      }
    }
  });

  Vue.prototype.$bus = Bus;
};

export default install;